<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
</head>
<body>
  <h1>vue数据绑定</h1>
  <span v-text="name"></span>
</body>
</html>
<script>
  // var data = {name: 1}
  // document.querySelector('[v-text="name"]').innerHTML = data.name

  function Vue (options) {
    Object.defineProperty(options.data, 'name', {
      // getter, setter
      get: function () {
        console.log('get')
      },
      set: function () {
        console.log('set')
      }
    })
  }

  var options = {
    data: {
      name: 1
    }
  }
  new Vue(options)
</script>